package com.engine.jucailinkq.attendance.vacation.job.holidaygeneration;

import com.engine.jucailinkq.attendance.vacation.service.VocationService;
import com.engine.jucailinkq.attendance.vacation.service.impl.VocationServiceImpl;
import com.engine.common.util.ServiceUtil;
import com.engine.jucailinkq.common.util.Utils;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import weaver.interfaces.schedule.BaseCronJob;

import java.util.Map;

@Slf4j
public class HolidayGenerationJob extends BaseCronJob {

    private VocationService basicsetService = ServiceUtil.getService(VocationServiceImpl.class);

    /**
     * 是否覆盖，1：覆盖，0：不覆盖
     */
    private String cover;

    /**
     * 发放日期
     */
    private String executeDate;
    @Override
    public void execute() {
        log.info("**********HolidayGenerationJob start ************");
        log.info("**********HolidayGenerationJob  executeDate :[{}]********",executeDate);
        Map<String,String> formmodeIdMap = Utils.getFormmodeIdMap();
        //假期额度模块id
        String modeId = formmodeIdMap.get("uf_jcl_kq_jqed");
        Map<String, Object> params = Maps.newHashMap();
        params.put("modeId",modeId);
        params.put("releaseDate",executeDate);
        params.put("cover",cover);
        basicsetService.generateVocation(params);
        basicsetService.handleOverdueVocation(params);

    }
}
